package com.byxy.managerial.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * 员工实体类
 */
@Entity
@Table(name = "m_staff")
public class Staff implements Serializable {
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue // id主键自增
	private Integer id;
	@Column(name = "sid", length = 25) // 员工编号,长度25
	private String sid;
	@Column(name="sname",length = 10) // 姓名,长度10
	private String sname;
	@Column(name="ssex",length = 1) // 性别,长度1，男或女
	private Character ssex;
	@Column(name="sage",length = 3) // 年龄，长度3
	private Integer sage;
	@Column(name="joindate")// 入职时间
	private Date joindate;

	// 员工所属部门：关联关系映射
	@ManyToOne
	@JoinColumn(name = "sdid") // 通过 JoinColumn 的name属性指定了外键的名称 sid
	private Department depart;

	public Staff() {
		super();
	}
	
	

	public String getSname() {
		return sname;
	}



	public void setSname(String sname) {
		this.sname = sname;
	}



	public Character getSsex() {
		return ssex;
	}



	public void setSsex(Character ssex) {
		this.ssex = ssex;
	}



	public Integer getSage() {
		return sage;
	}



	public void setSage(Integer sage) {
		this.sage = sage;
	}



	public Date getJoindate() {
		return joindate;
	}

	public void setJoindate(Date joindate) {
		this.joindate = joindate;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getSid() {
		return sid;
	}

	public void setSid(String sid) {
		this.sid = sid;
	}

	public Department getDepart() {
		return depart;
	}

	public void setDepart(Department depart) {
		this.depart = depart;
	}



	public Staff(String sid, String sname, Character ssex, Integer sage, Date joindate, Department depart) {
		super();
		this.sid = sid;
		this.sname = sname;
		this.ssex = ssex;
		this.sage = sage;
		this.joindate = joindate;
		this.depart = depart;
	}
	

}
